import nme.display.MovieClip;
import nme.events.Event;
import nme.media.Sound;
import nme.media.SoundChannel;
import nme.Assets;
import haxe.Timer;

class Home extends MovieClip { 

    public var span:Int;
    public var depth:Int;
    public var white:Int;
    public var black:Int;
    public var gray:Int;
    public var red:Int;
    public var yellow:Int;
    public var green:Int;
    public var blue:Int;
    public var calc:Calc;
    public var orchestra:Orchestra;
    public var rowNum:Int;
    public var colNum:Int;

    public function new(myCanvas:MovieClip) {
        super();

        // Declare the size of the flash object. As "width" and "height" are used, "span" and "depth" are substituted
        span = 970;
        depth = 600;

        // Declare some colors
        white = 0xFFFFFF;
        black = 0x000000;
        gray = 0x808080;
        red = 0xFF0000;
        yellow = 0xFFFF00;
        green = 0x8000;
        blue = 0x0000FF;

        // Create the calc, which contains general use functions
        calc = new Calc(this);

        // Create the orchestra, which will contain, manage, and play hums
        orchestra = new Orchestra(this);
        
        // colNum is the number of columns in a hum - how many notes will be played before the cycle repeats. rowNum will ultimately be set by the Orchestra
        colNum = 8;
        rowNum = 12;

        // Create some hums
        orchestra.newHum(0, 0, 300);
        orchestra.newHum(300, 0, 300);
        orchestra.newHum(600, 0, 300);

        myCanvas.addChild(this);
        
    } // public function new(myCanvas:MovieClip)

} // class Home extends MovieClip
